function Player(id, description) {
	this.id = id;
	this.description = description
}
		
function populateSelect(frm, isAll) {
    var playerList;
    if (isAll) {
       playerList = allPlayers;
    }
    else {
       playerList = players;
    }
	for (count = 0; count < playerList.length; count++) {
		frm.availPlayers.options[frm.availPlayers.options.length] = new Option(playerList[count].description, playerList[count].id);
	}
}

function filterSelect(enteredText, frm, isAll) {
    var playerList;
    if (isAll) {
       playerList = allPlayers;
    }
    else {
       playerList = players;
    }
	frm.availPlayers.options.length = 0;
	for (count = 0; count < playerList.length; count++) {
		if (playerList[count].description.toLowerCase().indexOf(enteredText.toLowerCase()) != -1) {
			frm.availPlayers.options[frm.availPlayers.options.length] = new Option(playerList[count].description, playerList[count].id);
		}
	}
}
function addNewPlayerToSelect(frm, selectName) {
	var player = frm.availPlayers.options[frm.availPlayers.selectedIndex];
	document.getElementById(selectName).options[document.getElementById(selectName).length] = new Option(player.text, player.value);
	frm.availPlayers.options[frm.availPlayers.selectedIndex] = null
}